<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRoleMenuRelationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('role_menu_relations', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('role_id',false,true)->default(0)->comment('角色id');
            $table->integer('menu_id',false,true)->default(0)->comment('权限id');
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `role_menu_relations` comment '角色权限关联表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('role_menu_relations');
    }
}
